package com.telecom.common.convention.errorcode;

/**
 * 基础错误码定义
 */
public enum BaseErrorCode implements IErrorCode {

    // ========== 成功 ==========
    SUCCESS("200", "操作成功"),

    // ========== 客户端错误 4xx ==========
    CLIENT_ERROR("400", "客户端错误"),
    UNAUTHORIZED("401", "未授权访问"),
    FORBIDDEN("403", "访问被禁止"),
    PARAM_VALIDATION_ERROR("400001", "参数验证失败"),

    // ========== 服务端错误 5xx ==========
    SERVICE_ERROR("500", "服务端错误");

    private final String code;

    private final String message;

    BaseErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }
}
